package com.example.shysx11.vos;

import lombok.Data;

@Data
public class ResultVo<T> {
    private Integer code;
    private  String message;
    private  T t;

    public ResultVo(Integer code, String message, T t) {
        this.code = code;
        this.message = message;
        this.t = t;
    }

    public ResultVo(Integer code, T t) {
        this.code = code;
        this.t = t;
    }

    public ResultVo(String message, T t) {
        this.message = message;
        this.t = t;
    }


    public static <T> ResultVo  success(T t){
        return  new ResultVo(6000,"成功");
    }
    public static <T> ResultVo  success(String message ,T t){
        return  new ResultVo(6000,message,t);
    }
    public static <T> ResultVo  error(T t){
        return  new ResultVo(7000,"失败");
    }
    public static <T> ResultVo  success(String message){
        return  new ResultVo(7000,message);
    }
}
